package com.nbclass.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/*
       AUTHOR: Jarvie -> YYDS
  CREATE TIME: 2024/9/13   
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result<T> {
    private Integer code;
    private String msg;
    private T data;
    public static <E> Result<E> Success(){
        return new Result(200,"操作成功",null);
    }
    public static<E> Result<E> Success(E data){
        return new Result<>(200,"操作成功",data);
    }
    public static <E> Result<E> Error(){
        return new Result(208,"操作失败",null);
    }
}
